package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/getnum")
    public Integer getNum() {
        return new Random().nextInt(10);
    }

    @RequestMapping("/hello")
    public String hello() {
//        Integer test = null;
//        test.toString();
        // System.out.println("hello!");
        return "hello";
    }

    @RequestMapping("/login")
    public String login() {
//        int result = 10 / 0;
        System.out.println("执行了 login");
        return "login";
    }

    @RequestMapping("/reg")
    public String reg() {
        return "test";
    }
}
